<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图片轮廓测试</title>
    <style>
        div.img{
            margin: 5px;
            border: 1px solid #ccc;
            float: left;
            width: 180px;
        }
        div.img:hover {
            border: 1px solid #777;
        }
        div.img img {
            width: 100%;
            height: auto;
        }

        div.desc {
            padding: 15px;
            text-align: center;
        }
        *{
            box-sizing: border-box;
        }
        .responsive{
            padding: 0 6px;
            float: left;
            width: 24.9999%;
        }
        @media only screen and (max-width: 800px){
            .responsive{
                width: 49.9999%;
                margin: 6px 0;
            }
        }
        @media only screen and (max-width: 600px){
            .responsive{
                width:100%;
            }
        }
        .clearfix:after{
            content: "";
            display: table;
            clear: both;
        }
    </style>
</head>
<body>
<div class="responsive">
    <div class="img">
        <a target="_blank" href="http://static.runoob.com/images/demo/demo1.jpg">
            <img src="../images/demo1.jpg" alt="图片文本描述" width="300" height="200">
        </a>
        <div class="desc">这里添加图片文本描述</div>
    </div>
</div>
<div class="responsive">
    <div class="img">
        <a target="_blank" href="http://static.runoob.com/images/demo/demo2.jpg">
            <img src="../images/demo2.jpg" alt="图片文本描述" width="600" height="400">
        </a>
        <div class="desc">这里添加图片文本描述</div>
    </div>
</div>
<div class="responsive">
    <div class="img">
        <a target="_blank" href="http://static.runoob.com/images/demo/demo3.jpg">
            <img src="../images/demo3.jpg" alt="图片文本描述" width="600" height="400">
        </a>
        <div class="desc">这里添加图片文本描述</div>
    </div>
</div>
<div class="responsive">
    <div class="img">
        <a target="_blank" href="http://static.runoob.com/images/demo/demo4.jpg">
            <img src="../images/demo4.jpg" alt="图片文本描述" width="600" height="400">
        </a>
        <div class="desc">这里添加图片文本描述</div>
    </div>
</div>
<div class="clearfix"></div>
</body>
</html>